Update different columns on different clauses
I would probably do something like this:

UPDATE tablename
SET col1 = col1 + CASE WHEN col1 &gt; $VAR THEN 2 ELSE 0 END,
    col2 = col2 + CASE WHEN col2 &gt;= $VAR THEN 2 ELSE 0 END
WHERE col1 &gt; $VAR OR col2 &gt;= $VAR


Make sure that col1 and col2 are indexed if you are only updating a few rows and tablename has many rows.