[EDIT] Seems martin_ meant you can buy a new button/sensor and a repair kit, and then follow instructions similar to these: http://www.imore.com/how-diy-repair-stuck-or-broken-iphone-4...
My power button crapped out on me several days ago, and I got it replaced under the stock warranty (NOT Apple Care) with no questions asked by making an appointment at the Genius Bar. Another friend did the same thing at a different location, and they again fixed her phone with no hassle.
I offer this personal anecdote to others in case they find themselves in a similar situation: try going into your nearest store and see what happens.
I should have qualified it as: Apple refuses to touch it if you've owned the iPhone for more than 12 months. (The apple discussions link made that more clear, but I should have quoted it here.)
https://discussions.apple.com/message/22136029#22136029