On Windows 8.1 64 bit, experiencing the problem described, "Windows 8.1 Update KB4340558 Fails with Error Code 80092004". I had a hunch that it was somehow related to last months optional "Preview of Quality Rollups..." for .NET Framework. Note, that once installed, you cannot readily and easily uninstall some of these rollups. So, I had to use System Restore to roll back the machine to a date before I installed the Preview of Quality Rollups, which was June 20, for me. Upon reboot, ran Windows Update, and was able to install all of the security updates, including KB4340558. Hope this helps.
Thanks for the help. This worked exactly as explained.