Insert into Passwords (ClientID,LocationID,Title,UserName,URL,Password,Notes,Expiredate) 
Values(15,14,'matchtopasswordtitle','Neostar153','',AES_ENCRYPT('PasswordNeostar22',SHA(' 16')),'',NULL);

UPDATE locations
SET locations.passwordID = (Select PasswordID FROM passwords WHERE title = 'matchtopasswordtitle') WHERE locationID=14;