Like everything in history it is a bit more complex than this. Parts of of Hong Kong were on perpetual leases while the New Territories were on 99 year lease [1]. In the end it all came down to pure politics and China was adimant that Hong Kong was to be returned in full. The UK was in no position to disagree.
1. https://en.m.wikipedia.org/wiki/Transfer_of_sovereignty_over...