Hi, Marcus,
Although I am not clear about the condition under which you update the code and boot from different source, I think it is okay to change value in the 0x40D and launch software Reset in your application code.
You can copy the page from 0x400 to an array, then execute page erase to erase the page from 0x400 in your application code, then modify the array corresponding 0x40d, then program the array to the page from 0x400. afterwards, you can execute software reset by setting the SYSRESETREQ bit in AIRCR register. For detailed inf, pls refer to user guide of Cortex-M4. After software reset, the K8x will reset based on new FOPT.
Hope it can help you
BR
Xiangjun Rong