Here is a link to the reason behind this question: NOW() for DATETIME InnoDB Transaction guaranteed?
So to ensure a single transaction with any number of queries (
Do it in MySQL, so you don't involve PHP at all:
select @now := now(); insert into .... values (@now) select from ... where x=@now etc....