UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+dPQvVsgfZcrp0mDJca+gGnT6tR1f0HF1jl4IjTh1pM=' 
WHERE 
  key_id = 'c08f3eeda9c71e946070e533ddec065a56a5b641ad49506f1c9a46043172deac' 
  AND (
    token = '+dPQvVsgfZcrp0mDJca+gGnT6tR1f0HF1jl4IjTh1pM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020