UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IateZcFErM2r2GaL82/ncjXaZo4JYuJUnXQjBLJcOEs='
WHERE
key_id = '79c0bba4ace425ce7d4eefc25f18f5a175747fee31e8809f16f1ff8b76d82b85'
AND (
token = 'IateZcFErM2r2GaL82/ncjXaZo4JYuJUnXQjBLJcOEs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)