Proving that the PhD work was done prior to someone else's patent I'm in a peculiar situation, which I'll try to describe as concisely as possible. 

Around three years ago I worked on something and I published a preliminary conference paper, which described the idea in great detail. I'm currently working on a PhD that's about this topic I published 3 years ago. Today I found out that there exists a patent that was accepted last year and it's like 50% about the same idea I published in that conference paper. Not 100%, it has some unique stuff in it and I'm pretty sure they didn't try to steal my idea, they probably came up with it on their own, that's why it has some additional features that I don't even need. But it's similar. I still haven't finished my PhD, but I'm worried—can this patent be a problem for me? I can prove with that conference paper that I was working on this idea years before the patent was submitted and published. 

What would be the best course here? I was thinking of citing this patent in my PhD, but if nobody said anything about it until now, I'm worried I just might start opening too many questions.

Any kind of ideas are greatly appreciated. I'm really, really worried that my PhD thesis can become invalid because of this patent. Is that possible?
You are right to be worried about a patent in the same field as your thesis research. 

You do have some protection in the form of having "prior publication" that shows your work predates the thesis. But this is not necessarily sufficient to protect your future work.

I would get into immediate contact with your thesis advisor, as well as the legal department of your university. They are trained in handling such issues, and can advise you as how best to proceed so as to protect yourself.

Note that the goal of talking to the legal department is not to file a lawsuit. The goal is to understand what are your rights as a researcher working in an area with an existing patent, and how you can show that you are avoiding infringement.