If your range is small, and you have an integers table, a naive approach might work:
SELECT GROUP_CONCAT(i SEPARATOR '|')
FROM ( SELECT i
FROM ( SELECT i
FROM integers
WHERE i BETWEEN 1 AND 50
ORDER BY RAND()
LIMIT 5) sort_these_five
ORDER BY i) concat_these_five;