I doubt if this is a problem with the keyboard. Can you attach an external keyboard and see if it reacts the same way? It is more likely to be caused by a program running in the background on the computer - malware might be the cause or a legitimate program such as antivirus running or Windows Updates being installed in the bckground. (There were a dozen or so released last week and if they have failed to install will retry every boot up)
Does this happen when you boot into safe mode as well?