UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2ARwmXek4k4RMXWDkidPgvNtHKtyXxbR9SpgDULEWio=' 
WHERE 
  key_id = 'a35664675d44960e4b30bf9e5300de086de4ba87261dae17e255de9073192c26' 
  AND (
    token = '2ARwmXek4k4RMXWDkidPgvNtHKtyXxbR9SpgDULEWio=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030