You got this backend code from the server:
SELECT * FROM users WHERE username = 'x'' AND password = ''
So you did this if you entered it into the password slot and x in the username slot:
SELECT * FROM users WHERE username = 'x' AND password = 'x';UPDATE users SET username = 'x', password = 'x';'
Note the extra ‘ on the end, which breaks the injection.
It would have been there with your second solution as well. You could try null byte poisoning to get rid of it, although I think the level is looking for a particular solution.