An accomplished century from Rob Yates lifted Warwickshire to a thrilling four-run Royal London Cup win over Sussex at Edgbaston.