A 50-year-old man with long-standing gastro-oesophageal reflux disease (GORD) reports progressive dysphagia and an unintentional 6 kg weight loss over 3 months. He has been self-medicating with over-the-counter proton pump inhibitors. Which is the most appropriate next step in management?