Holy Spirit baptism is certainly a condition of salvation, but the baptism that 'we' perform (water baptism) is a matter of obedience on our parts (perhaps the first and foremost matter or good work that we are called to do as believers) once we have been quickened/made alive/caused us to be born again, declared just & saved by God, that is, IOW, once we have been made us into wholly new creatures in Christ as His workmanship.
John 3:5-6
5 Jesus answered, “Verily, verily I say unto thee, unless a man be born of water and of the Spirit, he cannot enter into the Kingdom of God.
6 That which is born of the flesh is flesh; and that which is born of the Spirit is spirit.
Acts 2:38-41
38 Then Peter said unto them, “Repent and be baptized, every one of you, in the name of Jesus Christ for the remission of sins; and ye shall receive the gift of the Holy Ghost.
39 For the promise is unto you, and to your children, and to all who are afar off, even as many as the Lord our God shall call.”
40 And with many other words did he testify and exhort, saying, “Save yourselves from this untoward generation.”
41 Then those who gladly received his words were baptized, and that same day there were added unto them about three thousand souls.
Water baptism is an outward sign or demonstration of the inward transformation that has (already) taken place in a believer's heart (a transformation that occurred at the very moment that they first received and trusted Jesus Christ as their Savior and Lord, by faith .. e.g. John 5:24 .. the moment that they came into possession of eternal life).
Romans 6:3-4
3 Know ye not that as many of us as were baptized into Jesus Christ were baptized into His death?
4 Therefore we are buried with Him by baptism into death, that just as Christ was raised up from the dead by the glory of the Father, even so we also should walk in newness of life.
So, water baptism is an important work that a true believer does (again, as an act of obedience). It is meant to be part of his/her ~public~ confession of faith in the Lord Jesus Christ (something which was particularly difficult AND particularly important for Jews in the 1st Century to do).
Titus 3:5
5 He saved us not by works of righteousness which we had done, but according to His mercy, by the washing of regeneration, and by the renewing of the Holy Ghost,
This means that water baptism is part of the fruit that results from salvation, NOT a condition or cause of salvation.
1 Corinthians 6:11
11 And such were some of you. But ye are washed, ye are sanctified, ye are justified in the name of the Lord Jesus and by the Spirit of our God.
1 Peter 3:21
21 “…baptism, doth also now save us…”
We are saved by God, by what 'He' did/does for us, not by anything that 'we' do (as even the saving faith that we exercise when we choose to believe is a "gift" from God) .. e.g. Ephesians 2:8-10.
Ephesians 2:10
10 For we are His workmanship, created in Christ Jesus unto good works, which God hath beforehand ordained, that we should walk in them.