UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PShhKEzfuMWf4U0AgmLYrqTuJ/brq03ttZECfLo82ak=' 
WHERE 
  key_id = '4cc05bd1f2de0017d7ad26a7b2c06cd00e5a53a5bf4de47fd50844cbda744389' 
  AND (
    token = 'PShhKEzfuMWf4U0AgmLYrqTuJ/brq03ttZECfLo82ak=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047