UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EKmhHDYyoP8f+Kakmg3WDiklsG9cGgdTz8Ux7zxlL5Y=' 
WHERE 
  key_id = 'ef76780c6aee25002dcdd34136e431ea4b896f1a3d41da249c116cb752caa619' 
  AND (
    token = 'EKmhHDYyoP8f+Kakmg3WDiklsG9cGgdTz8Ux7zxlL5Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036