UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6qDKfTFB7hlKJ8mC9Gbu4SEkFwoAPgQsmn0nvBCqkWQ='
WHERE
key_id = 'f415cde877abe9b4d8289a5034c58c188baaa79ae051ba6bfc94785f040e3809'
AND (
token = '6qDKfTFB7hlKJ8mC9Gbu4SEkFwoAPgQsmn0nvBCqkWQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)