I assume this is for testing the mechanics of the key since you can write a program for a pulsed key input signal.
If you are looking for the MTBF you will want to have some guidance on the striker to keep from putting a side load on the key. Try to make the guidance long and the spring deflection 25% or less of max. The MTBF may be in the millions of cycles.
You could also use a servo driven linear actuator (electric cylinder). The cylinder is powered by 24vdc and can of course be controlled by a PLC. A reliable and easy to program electric cylinder is one from mirai international. This cylinder does not even need a PLC for control. It can be interfaced directly to an inexpensive laptop computer. As I said this device is very easy to setup and program. The end of the cylinder rod is threaded and can thus accomodate any type of tooling you can dream up.