Kansas City quarterback Patrick Mahomes threw for 423 yards and had three touchdowns to help his team defeat the San Francisco 49ers.