Before Squats? The spray is to relieve pain, but not before squats! If you fucked up your knee from squatting, then stop squatting until the pain goes away, then try squatting again, but deload the weight, and work up again, and watch your form. Otherwise, start saving up for a set of artificial knees.
P.S.: If you want magnesium to soak into your knees, then try soaking them in epsom salts!