The rule in my state is, if there's any way you can put your hand on the gun, it either has to be clearly visible or you need a concealed carry license. So if it's in a safe, you can touch the safe, and you have the key, it's a concealed weapon. In theory, if you locked the key in the trunk then the weapon is no longer accessible. But I wouldn't try it.
The gray area is a pickup truck or SUV where there isn't a separate trunk and the only way to transport a gun is inside the passenger compartment. Then put it as far out of reach as possible and hope for the best. That's the main reason I obtained a concealed carry permit - just as a CYA while driving to the range.