Tracking the ultrafast XUV optical properties of x-ray free-electron-laser heated matter with high-order harmonics