When I tried to execute those queries multiple times the only one Code executed and the notes updated on the first Code, the code doesn't wait the previous query till return the results when execute the query multiple times:
('SELECT * FROM X_Table where cId = 20 and dist is null order by id limit 1')
This query return data, one of it named Code. Lets assume that the result
'Code' = 'abcd1234'
(UPDATE X_Table SET dist = 1 WHERE code = 'abcd1234')
SET dist = 1 Query1 should give new results deference from the previous one 'Code'.
(UPDATE X_Table SET note = 'note' WHERE code = 'abcd1234')