SET autocommit = 0; START TRANSACTION; SET @conn_id = CONNECTION_ID(), @thread_id = 0; UPDATE t1 SET `int1` = `int1` - 4, `id` = 4, `is_consistent` = 0, `connection_id` = @conn_id, `thread_id` = @thread_id WHERE `pk` = 4; *** UPDATEing row with pk = 4 and `int1_key` +=4 if above statement succeeded (query log disabled)... COMMIT;