fix the following code for me 
DELIMITER $$

CREATE TRIGGER assign_api_key
AFTER INSERT ON app0_users
FOR EACH ROW
BEGIN
    UPDATE unassigned_api_keys
    SET client_id = NEW.user_email,
        active = 1
    WHERE client_id IS NULL
    ORDER BY created_at ASC
    LIMIT 1;
    
    UPDATE app0_users
    SET api_key = (
        SELECT un_api_key
        FROM unassigned_api_keys
        WHERE client_id = NEW.user_email
    )
    WHERE user_email = NEW.user_email;
END$$

DELIMITER ;
