UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r+tI7tSQPT8GS/uv6BIyRWW8oFHT32aViaVu8ZuX43k='
WHERE
key_id = '9008c912a356e09d84a1f0f6259c20be80b616ebe9f577cd255a1357bc58ff04'
AND (
token = 'r+tI7tSQPT8GS/uv6BIyRWW8oFHT32aViaVu8ZuX43k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)