UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '56+ho7dT3J2/Az6DaiN2qevckCH544JyQGQT+KX8EJQ=' 
WHERE 
  key_id = '1c8b3e781b3c937a6995e3ebce852448a30b06a48d829e202534812f90d9390d' 
  AND (
    token = '56+ho7dT3J2/Az6DaiN2qevckCH544JyQGQT+KX8EJQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025