UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+NPiE0eFwNuCG0YRJw/e69EcsggPyvbkNn3v1EAJwz0=' 
WHERE 
  key_id = '3c3a64baab045d57db58dd3360c6b0acd5b8f0273bff189ffc2d421e789f830c' 
  AND (
    token = '+NPiE0eFwNuCG0YRJw/e69EcsggPyvbkNn3v1EAJwz0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022