First P0340 is a camshaft sensor code not a crankshaft sensor code.

P0340 - Meaning, Causes, Symptoms, & Fixes
Check engine light code P0340 means Camshaft Position Sensor Circuit Malfunction. Find out how to fix it in this article!
www.fixdapp.com

P0123 Code - What It Means And How To Fix It
Don't know what P0123 code means or what to do about it? We've got you covered with everything you need to know about this engine code.

Personally I'd start with the P0340 and try to figure out what's going on there. Often one issue will cause codes in more than one system.