By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
create table mytable (
userid int,
dollars int
);
insert into mytable values (123, 400), (456, 600);
Records: 2 Duplicates: 0 Warnings: 0
update mytable
set dollars = dollars - 500
WHERE userID in (123,456) and dollars >= 500;
Rows matched: 1 Changed: 1 Warnings: 0
select * from mytable;
userid | dollars |
---|---|
123 | 400 |
456 | 100 |