UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L4RatRdUZUeTf6UpKshJWEGDFn4xf0Fj1odn2aM2R7c=' 
WHERE 
  key_id = '393ff69d2a7e59c82a8675815aab6f21518d22f5c08ad0f4c092a7f3644ed65b' 
  AND (
    token = 'L4RatRdUZUeTf6UpKshJWEGDFn4xf0Fj1odn2aM2R7c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022