Replace attachment file URL with another on specific attachment

I want to upload my images on another server and create an attachment post row in wp_posts table with external URL, but WordPress create permalinks automatically with site base URL. how can i update this URL for a specific attachment?

How can I replace attachment file URL with unique URL;

For example I have an URL like this: ‘https://my-site.com/wp-content/uploads/2021/07/image.png’;

I want to replace this URL with ‘https://dl.another-site.com/storage/image.png’;

Any solutions?