The keyboard on a T420 can easily be replaced by removing 2 screws under the laptop: one to open the memory/PCIe compartment, another to remove the keyboard itself.
Question is: Will changing the keyboard yourself void the warranty of the whole laptop?
No, changing your keyboard will not void the warranty. However, items damaged during self repair attempts may not be covered under warranty. This is generally a common sense consideration - if reasonable care is taken, there should not be any problems.
Lenovo service considers the complexity of a repair for each component on each system and classifies parts accordingly. CRU, or Customer Replaceable Units - Most hard drives, memory, and keyboards on many systems, can often be serviced by the removal of just a couple of screws. Batteries and AC adapters, ejectable DVD drives and other components that can be unplugged and removed without tools are often CRU parts.
FRU or Field Replaceable Units, are service parts that are more complex to remove and replace and are typically managed during warranty, through Lenovo service - depot, onsite, carry in repair at a service provider, or through authorized self maintainers.
Depending on the model of system, keyboards may be CRU or FRU parts.
The keyboard on a T420 is classified as an CRU. In a warranty situation Lenovo would ship a replacement, which the user will easily be able to replace.