UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6t4viJrLJ3rFj/mUPloqR20/7RPCQXmcBSH+UYwqtVM='
WHERE
key_id = '3cd9e93e47ffb80044aca0edf130e2fb665dd7ae2e74d41caaf31547f16dfb0f'
AND (
token = '6t4viJrLJ3rFj/mUPloqR20/7RPCQXmcBSH+UYwqtVM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)