UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UWOeQjPeOIgIFEow9On1G+crG4nJf+gMDbTlO4i5A7o='
WHERE
key_id = 'bd3ce027245be4cfa4e154a5b98b06bbe2d3cdcb925f9ff36f86760df865e4d1'
AND (
token = 'UWOeQjPeOIgIFEow9On1G+crG4nJf+gMDbTlO4i5A7o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)