UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jGQNUMCfQfGIOErr+dmbyFPHgmdKxA68nSptmLhy24M=' 
WHERE 
  key_id = '37cd053bf77f12d8f44351b596451ddd7997f5c19dea7e46e8e90495fa9e5722' 
  AND (
    token = 'jGQNUMCfQfGIOErr+dmbyFPHgmdKxA68nSptmLhy24M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017