You could make a Before hook for each of those tags and have that hook forcefully skip the test if the corresponding variable does not match. I don't know if there is an easy method for such a forced skip in all implementations of Cucumber (but Ruby does have one).
A better solution, however, would be to not tell Cucumber to run unnecessary tests in the first place. Run `cucumber -t ~@qa` or `cucumber -t ~@prod` (or whatever their equivalent is for your programming language of choice) as appropriate and have that decision be made by some other tool (e.g. your CI tool).
Eric K