UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EHq8dftqbfmcLuwGZ/bbtuuU/Ao29SnZbbra1aTdYMM=' 
WHERE 
  key_id = '76af7c5c0772d5c7d38cf45215a6a1901c334767ee2d95cbbee20c4c195a3d3b' 
  AND (
    token = 'EHq8dftqbfmcLuwGZ/bbtuuU/Ao29SnZbbra1aTdYMM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029