Alternatives to Crankset Shimano M523 Octalink 40-30-22T
If you're just riding casually, then a simple chainring replacement is probably all you need.  You don't have to match the styling, just the Bolthole Circle Diameter (BCD) and number of boltholes.     It looks like a 4 bolt pattern, but there are a number of standard sizes (naturally)
Personally I use a 100% printout of the PDF at https://cdn.shopify.com/s/files/1/0230/9291/files/Measure_BCD_5ad6ccfa-f146-4048-ac0f-e2279602c9e1.pdf and then overlay the chainring on the page.  You can see what BCD you need.   From https://www.wolftoothcomponents.com/pages/how-to-measure-bolt-circle-diameter-bcd
The four chainring bolts can probably be re-used without issue, provided you remove them without damage.
Staying with the same toothcount makes things simpler too, though you might choose to change things if there's a need, like if you're spinning out in 40:11.
There's a good chance you need a new chain too.  Based on the wear on the big chainring, its really quite worn.  Depending on how you ride, the middle and grannie ring teeth might be okay, but that big ring needs replacing.
I see no point changing a working octalink BB for something else, until it breaks down, and then you look at what options are available. You have matching cranks already.   If the bike us for a long distance trek or all-day MTB in the back country, you'd want to have decent options so replacing working parts might be reasonable then.  Or if the BB was crunchy and not suitable right-now, then a replacement might be in order.
However I'm firmly in favour of wearing it out - otherwise you're throwing away parts with life left in them still.
Do let us know how it goes too - final followup is always useful.