in the vast majority of instances electrical portion is the issue and yes when it goes bad, it causes key to become hard to turn etc. So, I'd start there as opposed to replacing entire barrel assembly which could run $1000 if done by dealer IIRC. Plus the electrical portion is easily DIY'able...
Cylinder can be DIY'able too but obviously is much more invasive... FWIW, many P-dealers these days won't even offer to do just the electrical portion but instead call for whole barrel replacement... Hmmm, service invoice of $100 or $1000, wonder why?
In all sincerity, sometimes the barrel does need replaced but as said before in the vast majority of cases it's just electrical switch portion. Do a search here and you will see.
Good luck