Just remember that sometimes those locked doors that require a key are quest locations that you are given the key when you are given the quest and entering them before that by using the console can mess up the quest !
Exactly.
To the OP-- it's pretty much NEVER a good idea to use the console to work around things like that. If you come on something that's locked with a key and you're positive you've looked absolutely everywhere and there's no key to be found, that pretty much only means one thing-- you're not supposed to be able to open it yet. And that can easily mean that at some point in some later quest, you're going to get the key to open it. But when you do, it'll already be open and there's at least a chance that that'll break the quest.
I can honestly only think of one quest in the entire game in which you just stumble on a key-locked chest and you have to find the key for it. Every other one I can think of is key-locked to keep you out of it unless you're on the relevant quest, and if you're on the relevant quest, you'll have the key.