UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kce00tcdzFGIg3xPCPtgtBmhrQAlcAd3D1IdVe1uNpc=' 
WHERE 
  key_id = 'dff71955edb04c4369cc40a6ddf7a9737b4bb3b37315eb50ab55648767aa0cd6' 
  AND (
    token = 'kce00tcdzFGIg3xPCPtgtBmhrQAlcAd3D1IdVe1uNpc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031