UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '84lXZanqJEpzom1laJWaG82oWHdhWN2vI8fU5HarQkA='
WHERE
key_id = 'bc9a0c70a10124cd85c0d7b675d3c0781e75dfff78e429719505bd3750018c20'
AND (
token = '84lXZanqJEpzom1laJWaG82oWHdhWN2vI8fU5HarQkA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)