UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uG1GJ+NUJjUB53JwoWGwFJmtmPBqJk/bHmOefBWTGTk='
WHERE
key_id = '0dc0bb4fc566b0c83bdeb23a09f546fc671397f86eaa4dd9836a11a7f448295a'
AND (
token = 'uG1GJ+NUJjUB53JwoWGwFJmtmPBqJk/bHmOefBWTGTk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)