UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cEnOf7hc1a/gOxBY6oXgYQq2DTuxZPP6AvfuRVeP6/Q='
WHERE
key_id = 'ac7c56049cfe71aa7c50d6805b8ba673a4f36d7d3ed71f057bf7f9f8ab066f65'
AND (
token = 'cEnOf7hc1a/gOxBY6oXgYQq2DTuxZPP6AvfuRVeP6/Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)