UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7S4Z1QgyVeXl0Fk8NPUH0H1y3h1ee3ZZ1lRaE7tJ494=' 
WHERE 
  key_id = '2772c01d001bc041b8441386ef998f9a68706cd42a0ac0a9b11bbac61351deea' 
  AND (
    token = '7S4Z1QgyVeXl0Fk8NPUH0H1y3h1ee3ZZ1lRaE7tJ494=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023