UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cXjFN2UAupcRoCGFLOgEgI9ObVpeILxA1yUlUf3243s=' 
WHERE 
  key_id = '53b68f41ad408375b8c8b3d53ee498b048d44fe9e8e1a3d42da96918036efdf9' 
  AND (
    token = 'cXjFN2UAupcRoCGFLOgEgI9ObVpeILxA1yUlUf3243s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016