If count is the only column you are updating (or you have no other criteria specified in the where clause), you can simply do this in the where clause
UPDATE [Table] SET counts = counts - 1 WHERE counts > 0;
However, if you update other columns in the same query, this will not work. But you have options
UPDATE [Table] SET counts = MAX(counts - 1, 0);
or
UPDATE [Table] SET counts = CASE WHEN counts > 0 THEN counts - 1 ELSE 0 END;
source share