UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EaZGlrojpLCoY/v0LvPizmjuZKTVfHUy8OZiM48Hnck=' 
WHERE 
  key_id = 'e9dabca88833d2e46be55280cb5279cc941bc51f19569b1e072de4c76f0e4bc9' 
  AND (
    token = 'EaZGlrojpLCoY/v0LvPizmjuZKTVfHUy8OZiM48Hnck=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028