Well one system you could make is to have a key array inside your character blueprint, you can make these keys as structs, strings, or integer depending on how many keys you have in your game and on the complexity you want.
Then you make the key have a variable of that type that you have inside your key array. When the character interacts with the key and you want to add it to the array, you cast to the character and use “Add unique” to add the key into the array. On the key blueprint, you set the key variable as instance editable so that you can change the key-id when placing them inside your levels.
When interacting with the door you trigger a check to see if the character has the key that is needed to open by casting and looping thru the characters key-array. If the right key is in then the interact can unlock the door. If it is already unlocked you open the door.
Hope this makes sense, I don’t have access to UE to show you a real exemple.