Use a helper column to work out the correct values
First, find the new quantity using VLOOKUP
:
=VLOOKUP(A2,SecondTable,2,FALSE)
this will give an error if the SKU is not found. We can use this to our advantage
=IFERROR(*The vlookup*,B2)
meaning if there is an error, use B2 rather than the error value.
putting this all together gives
=IFERROR(VLOOKUP(A2,SecondTable,2,FALSE),B2)
once you have all the new values, you can do what you want with them