Exact same problem here. Had the Lumia 520 since I think April/May 2013. Today randomly the power button started losing functionality. I popped off the back cover and still had issues when pushing the button itself with finger nail/paperclip, so it's definitely the button, not the case. Now it's pretty much dead. Really frustrating - holding the camera button down is a workaround to wake the phone up, but I don't think there's a way to switch it off, so I have to wait 30 seconds (the shortest you can set the lock screen setting to) before putting it in my pocket (or risk things being pressed).
Will be on to Vodafone to fix this tomorrow but I'm so busy and really don't have time to be faffing around with this
