UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'alX1Uomp2sLutObO8gZ89feY4AsSCxF00dQzMA+IcDI=' 
WHERE 
  key_id = '8eb483c19694386cb3d69895e3042863efba2d242c813c7e61ccc9b9eb014695' 
  AND (
    token = 'alX1Uomp2sLutObO8gZ89feY4AsSCxF00dQzMA+IcDI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017