From your screenshot above, you probably want
Z is pressed, condition (lockon=0) - set lockon to 1
Z is pressed, condition (lockon=1) - set lockon to 2
Don't use 'is down' or the key will be down during all variable changes and change the variable from 0 to 2.
If you actually do want to be able to hold the key down for some reason then you can use 'trigger once'