UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DCyxvlwNYHwxr54Xc+0S6OmAMlE9bEnK8IK0oBLJY3E='
WHERE
key_id = 'c96d3332b7a53f312ed2f4cf50a1045588f435f31aea555f2f34e6484b4d8ae5'
AND (
token = 'DCyxvlwNYHwxr54Xc+0S6OmAMlE9bEnK8IK0oBLJY3E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)