UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JQ9BmFN+HUi1jTRwDZ8/J7bYXgHnJKrPzjJe+84MEO8='
WHERE
key_id = '901869b4318db4ce620e7a0ddc42d343cc5e9529798d6c511cf4b138e93fb9bf'
AND (
token = 'JQ9BmFN+HUi1jTRwDZ8/J7bYXgHnJKrPzjJe+84MEO8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)