Combine the chopped tomatoes, onion, sugar, vinegar, and lemon juice in a large pot over medium heat. Stir until the sugar begins dissolving.
Bring to a gentle simmer, then reduce heat to maintain a steady bubble. Cook for 30-45 minutes, stirring every few minutes, until the chutney thickens and turns deep amber. The onions should be translucent and the tomatoes soft enough to mash with a wooden spoon.
Stir in the ginger, mustard seeds, cinnamon, and cayenne. Simmer another 10 minutes until the mixture coats the back of a spoon — if you drag your finger across it, the line should hold without running back together.
Let cool slightly before transferring to sterilized jars or an airtight container.