The normal way:

#pw+123456789012345+1#

But maybe it's not even locked, I am not sure.

When I put in another SIM, 8310 asks for security code.

I don't know it so I think I have to use a cable

(have to buy one 1st) and some proggie to reset this code 1st.

After that I can check if it's locked and try again if necessary.