You can read a key value, but not set it.
You can only set the value at the current time with expressions. Otherwise if you want to set the value of specific keyframes, you need to look at Extendscript and scripting.
Your two lines of expression above set the same value twice. The variable f is first set to the value of key 3 on the Particular property. Then it is overwritten by setting it to the value of the TestXXX slider.
You could try something along the lines of testing whether the current time is the same time as a certain key's time and if so, then setting the property to a certain value, but I think this isn't what you're trying to achieve.