UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tgNjlWTvE8p6N39rtjRarCihQbsxwmY6O6lUN3G4rOE=' 
WHERE 
  key_id = '242ed88caa8ddbab8bd90cbefd8a0b093a96594bb543f0d4fa963140d81c1fc9' 
  AND (
    token = 'tgNjlWTvE8p6N39rtjRarCihQbsxwmY6O6lUN3G4rOE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046