 In order for it to be unlocked, one should get to confession and then be in a state of grace. It'd be the same, by the way, for marriage. You could get married in a state of mortal sin. You certainly could receive holy communion in a state of mortal sin. And those sacraments are still valid in confirmation. You are validly confirmed if you're not in a state of grace. And in order to utilize the graces given in that sacrament, just get to confession and all will be well.