UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VRMw32T9b/QCvaK9H7pIuNQRwxkGyiNzV1P9iwO3qBs='
WHERE
key_id = '21b7217a80a9dba52f8a902ebcc07cd8efe03d243d6082397bc204669a4f0125'
AND (
token = 'VRMw32T9b/QCvaK9H7pIuNQRwxkGyiNzV1P9iwO3qBs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)