Have to write it this way ,like this if the condition is true it does not continues for secound
if col1 is null it does not check if col1 = @col1
SELECT *
FROM tableA
WHERE
(col1 is null or col1 = @col1) AND
(col2 is null or col2 = @col2) AND
(col3 is null or col3 = @col3) AND
(col3 is null or col4 = @col4) AND
ORDER BY colrk DESC