UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F8Vwkuq+CWiP0raPMz7dpUXFbOR+D/m6llQAnBsZbmE='
WHERE
key_id = 'cfe4067a4320ba0ca6c7fd7fe3eac0c21e4b6baf3d59a61441b26a1829c54913'
AND (
token = 'F8Vwkuq+CWiP0raPMz7dpUXFbOR+D/m6llQAnBsZbmE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)