UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'liX99onDwE7/WFwkivObyK48umtO8/IHjdUDeFjX1x0='
WHERE
key_id = '4a2c73fd7be8e3372cb19950a5bc8bf7214c3485d18c72fce7b4ac74f596820d'
AND (
token = 'liX99onDwE7/WFwkivObyK48umtO8/IHjdUDeFjX1x0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)