The simplest solution appears to be:
1.
Set the date on the Windows 7 computer to 12/03/2017. This is before the expiration date.
2.
Restart the computer.
3.
Run Windows Update (which should now be running).
4.
Check for updates, download any critical and important updates and install them.
5.
Restart the computer.
6.
With the date still set to 12/03/2017. Check to make sure Windows update is still working. It should be OK.
7.
Change the date back to the current date.
8.
Restart the computer.
9.
Verify that Windows Update works properly.
This fix apparently works at least 90 percent of the time and doesn’t seem to hurt anything even if it doesn’t work.