Kris Boyd struck twice as Kilmarnock ended a run of five matches without a victory with a 4-2 win over Hearts at Rugby Park.