I believe comm can make better performance:
comm -12 300KFile <(sed 's/,.*//' 30MFile)
ps. I'm not sure if string 123123 fromm 300KFile should match to string gdwyedg,123123,hfsjdkfh in 30M file.
As As in your script it matches, but in my script it doesn't.