It also depends on how well they were made. I have an IBM Model M keyboard that came with an IBM computer that I bought in 1986. That keyboard has been used daily since then and still works as if it was brand new. I've also had inexpensive keyboards where 1 or 2 keys stopped working after a few months use.
Older keyboards switches (the keys) were quite substantial mechanical switches. Everybody supplies rubbish now made in China. These use conductive paint for the contacts usually and the conductive paint wears away so the Chinese rubbish does not last long. Made in America (or Britain) yeah right supplied maybe but more often than not rebranded rubbish made in China.
Both of my cheap no name Amazon bought boards with Chinese mechanical switches have now lasted me 5 years, my G710+ has lasted me 7, My CODE 6, my Compaq membrane over 15, and the only 2 keyboards that actually died on me was a Razer Lycosa that my ex dumped a latte on and my Fatal1ty keyboard I spilled Dr Pepper on. Rule of thumb, if you take care of it it'll last.