It would be better if you could have actually include actual column names even with bogus data, however, I've named them corresponding with the type of content I think you are presenting.
It appears your second column is some "ID" column and want to keep them all grouped together. So, pre-query that in the order you want but only for the "Priority" column ignoring the rest of the records. THEN, using MySQL variables, you can assign it a sequential value for final output. Then join to the regular data on the "ID" column for all other values... Something like...
select
md2.ABCColumn,
SortSeqQuery.IDColumn,
md2.DescripColumn,
md2.ColumnWith123Sequence
from
my_Data md2
LEFT JOIN ( select
md1.IDColumn,
@SeqVal := @SeqVal +1 as FinalSortOrder
from
my_Data md1,
( select @SeqVal := 0 ) sqlvars
where
md1.DescripColumn = "priority"
order by
md1.ColumnWith123Sequence,
md1.IDColumn ) SortSeqQuery
on md2.IDColumn = SortSeqQuery.IDColumn
order by
case when SortSeqQuery.IDColumn is null then 2 else 1 end,
coalesce( SortSeqQuery.FinalSortOrder, 0 ) as FinalSort
With the "Order By", it pre-sorts the qualified data BEFORE it actually applies the @SeqVal which in turn should come back as 1, 2, 3, 4, etc...
The "SortSeqQuery" will be run first to pre-qualify any "priority" records and have them sorted and available. Then, your "my_data" table is basis of the query and joins to that result set and grabs the appropriate sort sequence based on matching ID column. If there are IDColumn entries that DO NOT have a priority, then they will also be included, but with the order by based on a case/when, any that are null are pre-sorted to the bottom, those found will be sorted to the top. Within that sort, it will keep all IDColumn entries grouped together since the same "FinalSortOrder" is directly associated to the IDColumn in the preliminary query.