UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RlnUhEXnJKi9y2XdVmhR/eKFQMWY7vDgeA6ZcDKtJjQ='
WHERE
key_id = '846e6b74dff68ec1f3b900057468622f7f33ac40d3706fa37052ae8d43ce04a5'
AND (
token = 'RlnUhEXnJKi9y2XdVmhR/eKFQMWY7vDgeA6ZcDKtJjQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)