What date did you enter the UK for the first time on your current visa (the date should be in the entry clearance stamp on your vignette in your passport)? You can apply for ILR up to 28 days before you reach 5 years from that date, which could be weeks or months earlier than July 22nd. You might have more time to apply than you realize before your trip.
But, yes, as long as your visa is valid, you are fine. The officer will probably say something about the close expiry date, but just tell him you're aware of it and that you are submitting your application in X days.