Honest question here... what makes you think that it should be performing better? Have you looked at any benchmarks to see what the GTX1050 should be getting at "normal settings" at 1080p with a similar cpu to yours? I ask because 90% of the posts like this end up being unrealistic expectations more so than parts not working like they should.
IMO, ~40 fps sounds about right with your parts.