SELECT 
  pf.feature_id, 
  pf.feature_style, 
  pf.position, 
  pf.purpose, 
  pf.display_on_catalog, 
  pfd.description, 
  pfd.internal_name, 
  pfd.prefix, 
  pfd.suffix, 
  (
    CASE WHEN pf.purpose = 'group_catalog_item' THEN 0 ELSE 1 END
  ) AS purpose_position 
FROM 
  cscart_product_features AS pf 
  INNER JOIN cscart_product_features_descriptions AS pfd ON pf.feature_id = pfd.feature_id 
  AND pfd.lang_code = 'en' 
WHERE 
  pf.feature_id IN (
    25186, 19794, 25184, 25183, 19586, 25161, 
    25143, 25158, 25178, 25142, 25177, 
    25129, 25144, 25174, 25176, 25138
  ) 
ORDER BY 
  purpose_position ASC, 
  pf.position ASC, 
  pf.feature_id ASC

Query time 0.00506

JSON explain

{
  "query_block": {
    "select_id": 1,
    "nested_loop": [
      {
        "read_sorted_file": {
          "filesort": {
            "sort_key": "case when pf.purpose = 'group_catalog_item' then 0 else 1 end, pf.position, pf.feature_id",
            "table": {
              "table_name": "pf",
              "access_type": "range",
              "possible_keys": ["PRIMARY"],
              "key": "PRIMARY",
              "key_length": "3",
              "used_key_parts": ["feature_id"],
              "rows": 16,
              "filtered": 100,
              "index_condition": "pf.feature_id in (25186,19794,25184,25183,19586,25161,25143,25158,25178,25142,25177,25129,25144,25174,25176,25138)"
            }
          }
        }
      },
      {
        "table": {
          "table_name": "pfd",
          "access_type": "eq_ref",
          "possible_keys": ["PRIMARY"],
          "key": "PRIMARY",
          "key_length": "9",
          "used_key_parts": ["feature_id", "lang_code"],
          "ref": ["dev_db.pf.feature_id", "const"],
          "rows": 1,
          "filtered": 100,
          "index_condition": "pfd.lang_code = 'en'"
        }
      }
    ]
  }
}

Result

feature_id feature_style position purpose display_on_catalog description internal_name prefix suffix purpose_position
19586 dropdown 0 group_variation_catalog_item N Choose Scent Chọn mùi hương 1
19794 dropdown_labels 0 group_variation_catalog_item N Choose pattern Choose pattern 1
25129 dropdown_labels 0 group_variation_catalog_item Y Choose hair tie color Choose hair tie color 1
25138 dropdown 0 group_variation_catalog_item N Choose Scent 10528_116 1
25142 dropdown_labels 0 group_variation_catalog_item Y Option Chọn tranh 1
25143 dropdown_labels 0 group_variation_catalog_item Y Option Chọn tranh 1
25144 dropdown_labels 0 group_variation_catalog_item Y Choose painting Chọn tranh 1
25158 dropdown_labels 0 group_variation_catalog_item Y Hình dạng/ Shape Hình dạng/ Shape 1
25161 dropdown_labels 0 group_variation_catalog_item Y Language Language 1
25174 dropdown_labels 0 group_variation_catalog_item Y Choose gift set 10293_giftset 1
25176 dropdown_labels 0 group_variation_catalog_item Y Choose gift set Chọn set quà 1
25177 dropdown_labels 0 group_variation_catalog_item Y Choose gift set Chọn set quà 1
25178 dropdown_labels 0 group_variation_catalog_item Y Choose gift set Chọn set quà 1
25183 dropdown_labels 0 group_variation_catalog_item Y Lựa chọn Lựa chọn 1
25184 dropdown_labels 0 group_variation_catalog_item Y Lựa chọn Lựa chọn 1
25186 dropdown_labels 0 group_variation_catalog_item N Changtest Changtest 1