Firstly have you checked the functionality of the camera key using the Diagnostics-function? In order to do this, find and tap Settings > About phone > Support > Xperia tests > Camera key.
Another thing you can try is to repair the software in the phone using a computer and Xperia Companion. Please note though that a software repair will erase all user data from the phone, so make sure to do a backup before proceeding with the repair in order to prevent data loss.
If the software repair do not manage to improve the functionality of the camera key I suggest that you get in contact with your local support team in order to have your phone sent to an authorized service center. If you have any questions regarding the service, such as routines, warranty and consumer laws, these type of questions are best answered by your Local support team as well, as they vary between markets.