Tim David made a brilliant unbeaten 140 – his maiden one-day century – as Surrey kept their hopes of reaching the knockout stages of the Royal London Cup alive with a seven-wicket win over Warwickshire at the Kia Oval.