I'm afraid that "software engineer in London" and "two years experience" says little to nothing about whether it's a good or bad salary for you to be earning - you're focused on all the wrong things.
While working on London naturally adds a good sum of money to the kind of salary you could expect (potentially £10k-£15k more than many other parts of the country due to living expenses, commuting, etc.), your own worth as a software engineer is based on a whole lot more than where you work or how long you've been working in a similar job.
A better question to ask is how much you are worth personally, given not only your experience, but your technical skills, ability to work with people, general work ethic, analytical/problem-solving skills, interpersonal and communication skills, how well you can work on a project or task by yourself, etc.
Two different people working in the same software engineering job in London are often worth completely different sums of money, so the amount of money you'll be offered for a job will depend on those factors. An employer may be more than willing to offer £40,000 or more for somebody who has less experience but demonstrates a very high technical ability, and shines in an interview with their 'soft' skills, problem solving skills, enthusiasm, etc.
Employers may also look at other people and decide that £40k is a bit much for them - it depends whether they assess those people as being a great asset to their company; companies are often willing to hire people on higher wages if they see a lot of potential - the quality of the person is important, and you can't measure quality in terms of experience - it's a complex thing to assess, and there's a lot of judgement involved.
If you really want to find out how much you are worth, then the best way is probably just to apply to jobs which are offering the kind of money you would like to earn, to attend interviews, and see whether you get offered the job. If you don't get offered a job, then you need to seek feedback and find out what your interviewers say about you. .