UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cJ0JaFf8GF04ivbnJHy9COQRNgyD6xSzfebqyJ7PW5U=' 
WHERE 
  key_id = '72d4f5d7eac5c734db4f084b27c6049590056ad1ce22d39181646c1df8f286a6' 
  AND (
    token = 'cJ0JaFf8GF04ivbnJHy9COQRNgyD6xSzfebqyJ7PW5U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020