UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8uImpMryjz96rgzj/DUXiB4MEZBu7Gg5lTXWv0IOKp0=' 
WHERE 
  key_id = 'f704921fb2dcb6a49ac376f4c6b1edc736dbcf417dec6916cf82231e1788c1a6' 
  AND (
    token = '8uImpMryjz96rgzj/DUXiB4MEZBu7Gg5lTXWv0IOKp0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044