SELECT 
  g.grid_id, 
  g.container_id 
FROM 
  cscart_bm_containers as c 
  LEFT JOIN cscart_bm_grids as g ON g.container_id = c.container_id 
WHERE 
  1 
  AND g.container_id IN (21, 22, 23, 24) 
ORDER BY 
  g.order, 
  g.parent_id, 
  g.grid_id ASC

Query time 0.00056

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "29.21"
    },
    "ordering_operation": {
      "using_filesort": true,
      "cost_info": {
        "sort_cost": "7.00"
      },
      "nested_loop": [
        {
          "table": {
            "table_name": "g",
            "access_type": "range",
            "possible_keys": [
              "container_id"
            ],
            "key": "container_id",
            "used_key_parts": [
              "container_id"
            ],
            "key_length": "3",
            "rows_examined_per_scan": 7,
            "rows_produced_per_join": 7,
            "filtered": "100.00",
            "index_condition": "((`satishecarter_march_003`.`g`.`container_id` in (21,22,23,24)) and (`satishecarter_march_003`.`g`.`container_id` is not null))",
            "cost_info": {
              "read_cost": "12.41",
              "eval_cost": "1.40",
              "prefix_cost": "13.81",
              "data_read_per_join": "5K"
            },
            "used_columns": [
              "grid_id",
              "container_id",
              "parent_id",
              "order"
            ]
          }
        },
        {
          "table": {
            "table_name": "c",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "container_id"
            ],
            "key_length": "3",
            "ref": [
              "satishecarter_march_003.g.container_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 7,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "7.00",
              "eval_cost": "1.40",
              "prefix_cost": "22.21",
              "data_read_per_join": "2K"
            },
            "used_columns": [
              "container_id"
            ]
          }
        }
      ]
    }
  }
}

Result

grid_id container_id
45 21
46 22
47 23
48 23
49 24
50 24
51 24