A 3700x will make your 4090 perform like a 4080 on new gen hardware. 5800x3d or 5700x if you want to go the cheaper route and maybe upgrade to AM5 next round when they drop their next X3d chips.
I've got the same CPU mated with a 6900xt and am buying a 5700x to keep things smooth for a few years before swapping platforms to AM5
My math says I can sell the 3700x for $100 give or take 20% & buy a 5700x for $190... under $100 upgrade will keep me happy for a while.
https://www.ebay.com/itm/125522220531
Initially I was thinking 5800x3d or 5800x but the upcharge for the x3d is a little high for my rather limited gaming & the 5800x is within 1% of the 5700x. Benefit of the 5700x over both 5800's is it runs considerably cooler than both.
That means I can keep on air cooling and still have 60C gaming & no loud and annoying AIO.
Realistically speaking the next few years should bring back cheaper PC parts (Waiting for AM5 boards, DDR5 to drop) & with AMD Pushing both Nvidia & Intel we should get some pretty impressive generational improvements & low prices to boot. Can't complain about that & a welcome change from the last few years.