Zo zou het niet zo goed moeten werken. Verander uw zoekopdracht in als
INSERT INTO `archive_course_users`
(`course_id`, `user_id`, `course_qty`)
SELECT @new_course_id, '$user_id', `course_qty`
FROM `current_course_users`
WHERE `course_id` = '$course_id'
AND `user_id` = '$user_id'
AND NOT EXISTS (
SELECT 1
FROM `archive_courses`
WHERE `original_course_id` = '$course_id'
AND `version` = '$current_version');