You can execute them in a single transaction:
START TRANSACTION;
update customers set customer_name = 'John' where customer_id=1;
update purchases set state='Accepted' where customer_id=1;
COMMIT;
If something fail inside the transaction all changes are rolled back