Well, if its really socket 1151 then for around 200 bugs the i5-8400 would be my choice and recommendation.
You should check upfront at the MSI homepage which Bios version is required to support which CPU. Potentially a Bios flash is needed before upgrading.