UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xnP/HFjH09NbPIaRzuMR2XAxiSPlUgxb8UP1VMXu5rg=' 
WHERE 
  key_id = 'a42df58e3181df9169265862f6da3d9cb69b40f90186ca7a491ce1b94b669e4e' 
  AND (
    token = 'xnP/HFjH09NbPIaRzuMR2XAxiSPlUgxb8UP1VMXu5rg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031