In order to answer this properly, we have to explain what include these 50 years of autonomy. In the Sino-British Joint Declaration, governments arranged to make the partial political handover. To take an example: Hong Kong's people can choose their mayor but after the selection made by the Chinese Communist Party which select -always- people that answer directly to the Central Government's policies. As for the financial sector, Hong Kong enjoy full financial freedom at the point to have their own dollar issued by HSBC; among other things, the treaty was known as One Country, Two Systems.
Now, why 50 years? Margaret Thatcher, in a speech maintained in the House of Lords, explained this point:
I asked Mr. Deng at the time why he had chosen 50 years. He told me that this was the time it would take for China's standard of living to come close to Hong Kong's. In the light of the way China's economy has grown since 1984, that may well be achieved considerably ahead of Mr. Deng 's original assessment.
So, there were two main interests showed by each country. For the UK, it was important that the people of Hong Kong maintained the freedoms (press, speech, religion among others referred in the common law) and for the Chinese Administration, the purpose was purely economic, given that Hong Kong was by the '90s a worldwide financial engine that helped China to continue growing through the commerce.