This is a common problem on these models, and it can happen for a couple reasons. First, make sure the button on the shift knob is not sticking, if it is, you will likely need a new shift knob.
The other possibility is that the shift lock release button is sticking due to debris in between the button and the shift leaver housing panel. To fix this I take the top panel off, clean the button and the button opening and take a file to the button to give it more clearance to avoid this from happening again.
Key stuck may be related to the shifter button not fully engaging when putting your vehicle into park. Touch the shifter button until it locks into place. Then you shouldn't have a problem getting your key out.. Had same issue with Key being stuck too in my 99' V70XC