Make sure that your vehicle is in the "Park" position. If the gear shifter is not fully engaged in the "Park" position, it may prevent the key from turning to the off position. Try wiggling the gear shifter a little to ensure it's fully in the "Park" position.
Also, if the steering wheel is under tension, it can prevent the key from turning to the off position. Try turning the steering wheel left and right while gently trying to turn the key to the off position. The key should turn when the steering wheel is in a position where it is not locked.