Restore database with different filename
you can create a table variable(or temp table) and insert all the .bak file metadata in that table and then fetch the row with max value of modified time.

DECLARE @FileMeta table (columns nvarchar(200));

INSERT INTO @FileMeta 
EXEC sys.xp_cmdshell 'dir D:\FolderName\*.bak';

SELECT * FROM @FileMeta 
WHERE columns not like '%volume%' 
AND columns is not null and columns not like '%bytes%';


Now you can get the creation date of the file as shown in this link, and Now from this table @FileMeta You can get the row for Max of creation date that will give you the most recent file.