I'd recommend a complete disassembly, thorough cleaning and reassembly in stages to ensure that the problem is fixed.
What I mean by stages, is after you thoroughly clean the parts, start with just the board, CPU, HSF and 1 stick of RAM hooked up to the PSU. Set the board on a mouse pad or box and just try to get into UEFI. Once in, load optimized defaults, shut down and move the stick of RAM to the next slot. Try to boot back into UEFI. Repeat the process until you've tried all of your RAM slots, and then go back through with the next stick of RAM. Once you've done that with all of your RAM, return it to your original configuration, plug in your boot drive, and boot into Windows. First, run a stress test (I like Intel's extreme tuning utility, but there're many) for a couple of hours, and so long as it passes, try to replicate the keyboard locking up. If all is good, plug any storage drives you have in, one at a time, testing in between. If all checks out so far, install your GPU (if you have one, I don't remember seeing that information). Repeat the tests. At this point, plug anything else you have normally connected in, and if all is still good reinstall into the case.
I realize that's a long list of stuff to do, and probably doesn't look like much fun either. It isn't. It is the best way to diagnose problems like this though, because every part can be the problem. It could be the CPU wearing out (least likely, but still possible), a failing RAM stick or slot, bad PSU, failing motherboard, failing or corrupt drive(s), OS corruption, failing GPU, case grounding issue or just simply too much dust build up, among other possible issues. With this process, you can rule everything out systematically, eventually either finding the issue or no longer having one.