UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I2F7mswe90LWTBKBKtQbf9ppj4Yv1iP/4QA938YkinU='
WHERE
key_id = '16cb88f4b26fd813d6377f219ef0ec812e9fe14d0115f325d7c56afd3bb14370'
AND (
token = 'I2F7mswe90LWTBKBKtQbf9ppj4Yv1iP/4QA938YkinU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)