the AI already knows how to open a door it is just sheer coincidence that they do it, if they decide a key gives them better survival chances than whatever they are holding they have a chance to pick it up, and if they are running away they will actively use the key if they run to the door it unlocks, but the odds are so low I've only HEARD them do it once on nightmare when I was hiding from the pred and heard a door get opened down the hall leading her to sprint off before she rounded the corner to spot me in the bathroom
the best way to encourage this action is to place items in well traveled areas like the middle of the halls, the AI will look at the item while standing and make their choice to pick it up, it's why I clean out rooms and slap everything in the hallways when I unlock a room lol