UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cvivesvOlxctEbJ3+VrZMlYmrapzFDDp3onPsZ+aQNY='
WHERE
key_id = 'a3381c63dfca5ee6c58d51e4618fd610ee71bfca7aa63665fee1977dcd019957'
AND (
token = 'cvivesvOlxctEbJ3+VrZMlYmrapzFDDp3onPsZ+aQNY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)