Please Create product-save.php file at magento root directory, add below code and run url :http://yourdomain/product-save.php or you can run script via command line
<?php
error_reporting(E_ALL | E_STRICT);
$mageFilename = 'app/Mage.php';
require_once $mageFilename;
Mage::setIsDeveloperMode(true);
ini_set('display_errors', 1);
ini_set('memory_limit', '600M');
ini_set('max_execution_time', 1800);
umask(0);
Mage::app('admin');
$products = Mage::getResourceModel('catalog/product_collection')
->addAttributeToSelect('*')
->addAttributeToFilter('type_id', 'configurable');
$productModel = Mage::getModel('catalog/product');
foreach ($products as $product) {
$productNameLowercase = strtolower($product->getName());
$productKey = newurlkey($productNameLowercase);
$productUpdate = $productModel->load($product->getId());
$productUpdate->setUrlKey($productKey);
$productUpdate->save();
}
function newurlkey($string)
{
$string = str_replace(' ', '-', $string); // remove spaces with hyphens.
return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
}