The 28-year-old former Arsenal stopper joined the Town as a free agent after leaving AFC Wimbledon in the summer of 2017.
Since then he has played a major role in successive promotions from Sky Bet League Two to the Championship, being the joint winner of the League One Golden Glove last season for his 19 clean sheets.
Shea has made 62 appearances for the Hatters, although just three so far this term, all in the Carabao Cup, with club record signing Simon Sluga getting the nod between the posts.
However, Shea told the club's official website: "I’m over the moon to get it done.
"The gaffer mentioned it to me a while ago, and I’m delighted it’s all sorted and we can concentrate on the football.
“It’s a bit different to a couple of years ago when I first signed and we were in League Two.
"To where we are now, it’s been an amazing journey, and I’m sure there’s a lot more still to go, which I can’t wait to be a part of.
“I’m not in the team at the minute, but I love it here.
"From day one when I joined, I wake up every day and look forward to coming. I’m glad I’m going to be here for a bit longer now.”
Manager Graeme Jonesa said: “I’m absolutely delighted that James has re-signed, securing his long-term future at the club.
"I’ve been really impressed with him since I came in, but also I think signing James helps secure the long-term future of Luton.
“He’s a wonderful character to have around the football club and a very, very competent goalkeeper whose day-to-day standards are a wonderful example to everybody here.”
On working with the new manager, Shea added: “He’s been brilliant with me. He’s the one who wanted me to get the new contract sorted, which is great for me.
“He spoke to me when he first came in, told me what he likes about me, what he wants me to improve on and I just want to play for him and for the club.
"I’m over the moon that it’s all done.”
Shea has also agreed to fill James Justin’s boots as the player patron for the Luton Town Disabled Supporters’ Association.