UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QBhcItngBnCokrHmZsDabrIm9ZZGzYLlzyBBEXRR/84='
WHERE
key_id = '021102dd89f2569c006d455834a06f7b7d8e29d1b861dcd1549ced148be4765a'
AND (
token = 'QBhcItngBnCokrHmZsDabrIm9ZZGzYLlzyBBEXRR/84='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)