UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'clf9oMFw8DuM5/ehpfTZ0WI2fP1/JNvMBECurlZ6cDo=' 
WHERE 
  key_id = '86ddcd84c4e347cd6225414dd059fb0cf585c3346ec4ec2553b03dd0d042cee4' 
  AND (
    token = 'clf9oMFw8DuM5/ehpfTZ0WI2fP1/JNvMBECurlZ6cDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042