I think it is going to be impossible to figure what the cause is by when and how it's shutting down. No consistency.

Try removing all devices and cards that are not necessary. unplug your ram, vid card, hard drive connectors and plug them back in. This sometimes can clean the contacts. Look for bulging caps. I had this happen once on a vid card. I would get the bsod randomly.

essential try running the computer with the bare minimum. unplug all usb devices.

Pat