UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9fiSSP7a5uOoOudeNWt6U3aDCxUe7Bsy94oqLzc+GBo='
WHERE
key_id = 'a5c193df8e12f04cc56f5ff1e33c3e183a10bd59f63b929bd644a391b1bb4f81'
AND (
token = '9fiSSP7a5uOoOudeNWt6U3aDCxUe7Bsy94oqLzc+GBo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)