Heathrow is not really a nightmare (he says in defence of his home airport), but you will have trouble doing this especially if you get an ATC delay on the way in (quite common I'm afraid). You'll stay in the same terminal and I could probably do this and get back to the gate in 30 minutes, but I really would not rely on it. If that computer picks you for a random check then I'd be worried about missing the flight!