Mark Williams captured his first title in over two years by defeating Mark Selby 4-3 in the final of the Rotterdam Open.