Are queries called parallel or in sequence?
With autocommit = ON, the two queries will run one after the other.

With

BEGIN;
some stuff
that UPDATE 
more stuff
ROLLBACK; -- either explicitly, or because of some error


the UPDATE will be undone.

Check for errors after every query.

(If this does not suffice, please provide more info.)