UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '94FAQPol33Czc//vaGwbTWl3BN2CXcEAgF1EvLf90rk=' 
WHERE 
  key_id = '97d132412bed38c4a8508ab581264547c3f4ff1015262a2b6b5cb5a34d344643' 
  AND (
    token = '94FAQPol33Czc//vaGwbTWl3BN2CXcEAgF1EvLf90rk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013