UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dl97XPrxldqJOYzNIFnBaI4ElFFzKLojhXF4yxS0wQc='
WHERE
key_id = '88c80d642cf6083223a5e798d80e345bfe2a8457c67a8e6b5f43d1d9c93d8da9'
AND (
token = 'dl97XPrxldqJOYzNIFnBaI4ElFFzKLojhXF4yxS0wQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)